<template>
  <div class="chat">
    <hy-editor v-model:value="htmlString" />
    <div class="btn">
      <el-button type="primary" @click="textInformation">提交</el-button>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import HyEditor from '../../../../components/editor/index'
import { createStory } from '../../../../service/story/story'
export default defineComponent({
  name: 'chat',
  components: {
    HyEditor
  },
  setup() {
    const htmlString = ref<string>('coderwhy')
    const textInformation = () => {
      createStory('/story', {
        data: {
          title: 'coderwhy',
          content: htmlString.value
        }
      })
    }
    return {
      htmlString,
      textInformation
    }
  }
})
</script>

<style scoped>
.btn {
  text-align: right;
  margin: 5px;
}
</style>
